Closed
Bug 1307570
Opened 9 years ago
Closed 9 years ago
Add XZ Embedded to enable LZMA-decompression in the custom linker
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(firefox52 fixed)
RESOLVED
FIXED
Firefox 52
Tracking | Status | |
---|---|---|
firefox52 | --- | fixed |
People
(Reporter: esawin, Assigned: esawin)
References
Details
Attachments
(1 file, 7 obsolete files)
100.18 KB,
patch
|
esawin
:
review+
|
Details | Diff | Splinter Review |
Moving patch 1 out of bug 1294736.
Comment hidden (obsolete) |
Assignee | ||
Comment 2•9 years ago
|
||
That's the initial version of the files we need.
Attachment #8797766 -
Flags: review?(mh+mozilla)
Assignee | ||
Comment 3•9 years ago
|
||
Add readme and update script.
Let's keep compiler warnings off until the __always_inline issue is fixed on upstream (assuming that's going to be accepted).
Attachment #8797765 -
Attachment is obsolete: true
Attachment #8797765 -
Flags: review?(mh+mozilla)
Attachment #8797778 -
Flags: review?(mh+mozilla)
Comment 4•9 years ago
|
||
Comment on attachment 8797778 [details] [diff] [review]
0001-Bug-1307570-1.1-Add-XZ-Embedded-support-configuratio.patch
Review of attachment 8797778 [details] [diff] [review]:
-----------------------------------------------------------------
::: config/external/moz.build
@@ +60,5 @@
> 'media/libsoundtouch',
> ]
>
> +if CONFIG['MOZ_LINKER']:
> + external_dirs += ['modules/xz-embedded']
Please don't land both patches independently, this will leave the tree in a non-buildable state on one of the changesets, making bisect more broken than usual.
::: modules/xz-embedded/moz.build
@@ +4,5 @@
> +# License, v. 2.0. If a copy of the MPL was not distributed with this
> +# file, You can obtain one at http://mozilla.org/MPL/2.0/.
> +
> +EXPORTS += [
> + 'linux/xz.h',
Why put things in a subdirectory? Especially, we'll likely end up using this on all platforms for something else, and the directory being "linux" will just be weird.
::: modules/xz-embedded/update.sh
@@ +2,5 @@
> +
> +# Script to update the Mozilla in-tree copy of XZ Embedded.
> +# Run this within the /modules/xz-embedded directory of the source tree.
> +
> +MY_TEMP_DIR=`mktemp -d -t xz-embedded_update.XXXXXX` || exit 1
$() instead of ``
@@ +6,5 @@
> +MY_TEMP_DIR=`mktemp -d -t xz-embedded_update.XXXXXX` || exit 1
> +
> +git clone http://git.tukaani.org/xz-embedded.git ${MY_TEMP_DIR}/xz-embedded
> +
> +COMMIT=`(cd ${MY_TEMP_DIR}/xz-embedded && git log | head -n 1)`
COMMIT=$(git -C ${MY_TEMP_DIR}/xz-embedded rev-parse HEAD)
@@ +7,5 @@
> +
> +git clone http://git.tukaani.org/xz-embedded.git ${MY_TEMP_DIR}/xz-embedded
> +
> +COMMIT=`(cd ${MY_TEMP_DIR}/xz-embedded && git log | head -n 1)`
> +perl -p -i -e "s/\[commit [0-9a-f]{40}\]/[${COMMIT}]/" README.mozilla;
This doesn't do anything when running the script with the current contents of README.mozilla.
@@ +20,5 @@
> +mv ${MY_TEMP_DIR}/xz-embedded/linux/lib/xz/xz_crc32.c linux/
> +mv ${MY_TEMP_DIR}/xz-embedded/linux/lib/xz/xz_dec_stream.c linux/
> +mv ${MY_TEMP_DIR}/xz-embedded/linux/lib/xz/xz_dec_lzma2.c linux/
> +rm -rf ${MY_TEMP_DIR}
> +hg add linux
you want addremove
Attachment #8797778 -
Flags: review?(mh+mozilla)
Updated•9 years ago
|
Attachment #8797766 -
Flags: review?(mh+mozilla)
Assignee | ||
Comment 5•9 years ago
|
||
Merged patched and addressed comments.
(In reply to Mike Hommey [:glandium] from comment #4)
> Why put things in a subdirectory? Especially, we'll likely end up using this
> on all platforms for something else, and the directory being "linux" will
> just be weird.
Putting the xz library into a subdir helps with maintaining a clean structure between our files and the external files and avoids potential conflicts (not really a danger in this case).
I've renamed the subdir to lib.
Attachment #8797766 -
Attachment is obsolete: true
Attachment #8797778 -
Attachment is obsolete: true
Attachment #8798016 -
Flags: review?(mh+mozilla)
Comment 6•9 years ago
|
||
Comment 7•9 years ago
|
||
(In reply to Chris AtLee [:catlee] from comment #6)
> https://treeherder.mozilla.org/#/jobs?repo=try&revision=2661af69fa2c
whoops, ignore the noise
Comment 8•9 years ago
|
||
Comment on attachment 8798016 [details] [diff] [review]
0001-Bug-1307570-1.2-Add-XZ-Embedded-support-configuratio.patch
Review of attachment 8798016 [details] [diff] [review]:
-----------------------------------------------------------------
::: modules/xz-embedded/update.sh
@@ +10,5 @@
> +COMMIT=$(git -C ${MY_TEMP_DIR}/xz-embedded rev-parse HEAD)
> +perl -p -i -e "s/\[commit [0-9a-f]{40}\]/[${COMMIT}]/" README.mozilla;
> +
> +rm -rf lib
> +mkdir lib
Make that src.
@@ +18,5 @@
> +mv ${MY_TEMP_DIR}/xz-embedded/linux/lib/xz/xz_lzma2.h lib/
> +mv ${MY_TEMP_DIR}/xz-embedded/linux/lib/xz/xz_stream.h lib/
> +mv ${MY_TEMP_DIR}/xz-embedded/linux/lib/xz/xz_crc32.c lib/
> +mv ${MY_TEMP_DIR}/xz-embedded/linux/lib/xz/xz_dec_stream.c lib/
> +mv ${MY_TEMP_DIR}/xz-embedded/linux/lib/xz/xz_dec_lzma2.c lib/
Catlee's try push made me think you should also add the BCJ filter decoder. They allow for better compression of code, which should be a good thing for libxul.
He also added crc64, which, as it happens, is the default used by xz when compressing, so you should need it too, except if you pass -C crc32 to xz.
Attachment #8798016 -
Flags: review?(mh+mozilla)
Comment 9•9 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #8)
> Catlee's try push made me think you should also add the BCJ filter decoder.
> They allow for better compression of code, which should be a good thing for
> libxul.
For last nightly's libxul.so:
original: 73078500
xz/xz --lzma2: 19151920
xz --armthumb --lzma2: 18340900
Assignee | ||
Comment 10•9 years ago
|
||
Addressed comments.
I've planned to investigate optimization options in a follow-up bug once the basic version has landed, but it makes sense to include the required files at this stage.
I've ran some tests with different BCJ filters and CRC settings:
Filter CRC APK size Extraction duration (avg.) [ms]
none none 28375099 3105
none CRC32 " 3277
none CRC64 " 3506
ARM none 28468347 3108
ARMTHUMB none 27410547 3146
ARMTHUMB decreases the APK size by another MB, CRC32 adds ~200ms and CRC64 ~300ms to the decompression duration.
Since the APK is already CRC-signed, we're not getting much by enabling CRC for the decompressed libraries. Although, with bug 1298090 decompression times are not a real concern either.
Attachment #8798016 -
Attachment is obsolete: true
Attachment #8799753 -
Flags: review?(mh+mozilla)
Assignee | ||
Comment 11•9 years ago
|
||
s/XZ_DEC_CRC64/XZ_USE_CRC64
There seems to be an issue running CRC64 and ARMTHUMB together. Given that there is no real benefit from using CRC64 over CRC32 and the README advises using CRC32 in embedded situations to reduce size, we shouldn't block on this issue here.
Attachment #8799753 -
Attachment is obsolete: true
Attachment #8799753 -
Flags: review?(mh+mozilla)
Attachment #8799904 -
Flags: review?(mh+mozilla)
Assignee | ||
Comment 12•9 years ago
|
||
I've found the issue with enabling CRC64, I've posted a patch in bug 1294736, too, if we still want that.
Attachment #8800019 -
Flags: review?(mh+mozilla)
Comment 13•9 years ago
|
||
Comment on attachment 8799904 [details] [diff] [review]
0001-Bug-1307570-1.3-Add-XZ-Embedded-support-configuratio.patch
Review of attachment 8799904 [details] [diff] [review]:
-----------------------------------------------------------------
::: modules/xz-embedded/update.sh
@@ +1,4 @@
> +#!/bin/sh
> +
> +# Script to update the Mozilla in-tree copy of XZ Embedded.
> +# Run this within the /modules/xz-embedded directory of the source tree.
You should just add `cd $(dirname $0)`, so that this requirement goes away.
Attachment #8799904 -
Flags: review?(mh+mozilla) → review+
Comment 14•9 years ago
|
||
Comment on attachment 8800019 [details] [diff] [review]
0002-Bug-1307570-2.0-Switch-XZ-Embedded-to-CRC64-integrit.patch
Review of attachment 8800019 [details] [diff] [review]:
-----------------------------------------------------------------
Please fold both patches.
Attachment #8800019 -
Flags: review?(mh+mozilla) → review+
Assignee | ||
Comment 15•9 years ago
|
||
Addressed comments and merged patches.
Attachment #8799904 -
Attachment is obsolete: true
Attachment #8800019 -
Attachment is obsolete: true
Attachment #8802103 -
Flags: review+
Comment 16•9 years ago
|
||
Pushed by esawin@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/5f09af81e038
[1.4] Add XZ Embedded support configuration, scripts and the initial library version. r=glandium
Comment 17•9 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox52:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 52
Updated•4 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•